<?php
require_once('config.inc.php');//$pdo; $uid; ROOT
$imgs = array_merge(glob('./uploads/temp/*.jpg'),glob('./uploads/temp/*.png'), glob('./uploads/temp/*.jpeg'));
//print_r($imgs);
//echo count($imgs);
$index = 0;
foreach($imgs as $img){
	//$img = './uploads/temp/5f43353c475.jpg';
	$sql = "SELECT id FROM stu_info WHERE card_p='$img' OR card_p1='$img'";
	//echo $sql.'<br>';
	$stmt = $pdo->query($sql);
	$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
	//print_r($result);
	$rows = count($result);
	if($rows == 0){
		unlink($img);
		echo '删除'.$img.'文件<br>';
	}
	
}



?>